<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Function Info.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>onDrag (Callback)</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<style type="text/css">
<!--
.style3 {font-size: medium}
-->
</style>

<link href="../../WinXStyles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-size: x-large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style2 {
	font-size: large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>

<body>
<h1 class="style1"><img src="../../WinX48.png" width="48" height="48" align="absmiddle"> <!-- InstanceBeginEditable name="title" -->onDrag (Callback)<!-- InstanceEndEditable --></h1>
<hr>

<!-- InstanceBeginEditable name="Prototype" -->
<p>allow = onDrag (idControl, code, item, x, y)</p>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="Description" -->
<p>This callback is invoked when the user attempts to drag a list box or tree view item.</p>
<!-- InstanceEndEditable -->
<table width="80%" border="1" cellpadding="0" cellspacing="0">
  <tr bgcolor="#CCCCCC">
    <th width="24%"><span class="style3">Parameter</span></th>
    <th width="76%"><span class="style3">Description</span></th>
  </tr>
  <!-- InstanceBeginRepeat name="Parameter Table" --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->idControl<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The id of the control that generated the event <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->code<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->A constant identifying what kind of dragging event occured <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->item<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The item in the control to which this event applies <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->x<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The x position of the mouse, relative the the upper left hand corner of the control <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->y<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The y position of the mouse, relative to the upper left hand corner of the control <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat -->
</table>
<h3>Returns</h3>
<!-- InstanceBeginEditable name="Return Info" -->
<p>$$TRUE to allow the dragging, $$FALSE to cancel it </p>
<!-- InstanceEndEditable -->
<h3>Remarks</h3>
<!-- InstanceBeginEditable name="Remarks" -->
<p>This is a callback function. You must supply this function yourself. To register this callback, use the <a href="WinXRegOnDrag.htm">WinXRegOnDrag</a> function.</p>
<p>Possible values for code are:</p>
<dl>
  <dt>$$DRAG_START</dt>
  <dd>The dragging operation is beginning. If you cancel here the entire operation is denied. The item parameter contains the item which is to be dragged.</dd>
  <dt>$$DRAG_DRAGGING</dt>
  <dd>The item is being dragged and has not yet been released. If you cancel here, the cursor becomes a crossed circle indicating to the user that this is not a valid place to drop the item. The item parameter contains the item underneath the cursor, or an invalid value (0 or -1 depending on the control) if there is no item underneath the cursor.</dd>
  <dt>$$DRAG_DONE</dt>
  <dd>The user dropped the item. It makes no difference what you return for this code. The item parameter is the item underneath the mouse cursor, or an invalid value if there is no item underneath the cursor</dd>
</dl>
<p>Different controls implement dragging in different ways, and hence will make slightly different use of this function.</p>
<!-- InstanceEndEditable -->
<h3>Examples</h3>
<table width="80%"  border="0">
  <tr>
    <td bgcolor="#C6C6FF"><!-- InstanceBeginEditable name="Example Code" --><span class="codeStyle">See the dragList and treeView examples in the samples folder. </span><!-- InstanceEndEditable --></td>
  </tr>
</table>

<h2 class="style2">Related Links</h2>
<!-- InstanceBeginEditable name="Related Links" -->
<p><a href="WinXRegOnDrag.htm">WinXRegOnDrag</a></p>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>
